public class DAY0407 {
    public boolean isAlphanumeric(char c) {
        // write your code here
        if(c>='0'&&c<='9'||c>='a'&&c<='z'||c>='A'&&c<='Z'){
            return true;
        }
        return false;
    }
    public char lowercaseToUppercase(char character) {
        // write your code here
        return character &= -33;
    }
    public int maxOfThreeNumbers(int num1, int num2, int num3) {
        // write your code here
        num1=Math.max(num1,num2);
        num2=Math.max(num1,num3);
        return num2;
    }
    public boolean isLeapYear(int n) {
        // write your code here
        // 被 4 整除且不能被 100 整除 或者 可以被 400 整除
        return (n%4==0&&n%100!=0||n%400==0);
    }
    public int getTheMonthDays(int year, int month) {
        // write your code here
        int[] months=new  int[]{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
        if(year%4==0&&year%100!=0||year%400==0){
            months[1]=29;
        }
        return months[month-1];
    }
    public void swapIntegers(int[] a, int index1, int index2) {
        // write your code here
        int tmp=a[index1];
        a[index1]=a[index2];
        a[index2]=tmp;
        System.out.println(a);
    }
}
